package com.dragon.modules.yuegou.client.wechat_mini.security;

import com.dragon.modules.yuegou.client.wechat_mini.common.MiniConfig;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

public class DefaultMiniRegistry implements MiniRegistry {

	private final ConcurrentMap<String, MiniConfig> cache = new ConcurrentHashMap<>();

	public DefaultMiniRegistry() {
		super();
	}

	public DefaultMiniRegistry(Map<String, MiniConfig> configs) {
		cache.putAll(configs);
	}

	@Override
	public void put(String name, MiniConfig config) {
		cache.put(name, config);
	}

	@Override
	public MiniConfig get(String name) {
		return cache.get(name);
	}

}
